<template>
  <div class="error-404">
    <div class="error-container">
      <div class="error-content">
        <div class="error-number">404</div>
        <div class="error-title">页面未找到</div>
        <div class="error-description">抱歉，您访问的页面不存在或已被移除</div>
        <div class="error-actions">
          <a-button type="primary" @click="goHome" size="large">
            返回首页
          </a-button>
          <a-button @click="goBack" size="large"> 返回上页 </a-button>
        </div>
      </div>
      <div class="error-illustration">
        <div class="floating-elements">
          <div class="element element-1"></div>
          <div class="element element-2"></div>
          <div class="element element-3"></div>
          <div class="element element-4"></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

const goHome = () => {
  router.push('/')
}

const goBack = () => {
  router.go(-1)
}
</script>

<style lang="scss" scoped>
.error-404 {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  box-sizing: border-box;
}

.error-container {
  display: flex;
  align-items: center;
  max-width: 1400px;
  width: 100%;
  gap: 60px;
}

.error-content {
  flex: 1;
  text-align: left;
  color: white;
}

.error-number {
  font-size: 120px;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 20px;
  background: linear-gradient(45deg, #fff, #f0f0f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.error-title {
  font-size: 36px;
  font-weight: 600;
  margin-bottom: 16px;
  color: white;
}

.error-description {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 40px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 400px;
}

.error-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;

  .arco-btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    }
  }
}

.error-illustration {
  flex: 1;
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-elements {
  position: relative;
  width: 300px;
  height: 300px;
}

.element {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: float 6s ease-in-out infinite;
}

.element-1 {
  width: 80px;
  height: 80px;
  top: 20px;
  left: 50px;
  animation-delay: 0s;
}

.element-2 {
  width: 60px;
  height: 60px;
  top: 120px;
  right: 30px;
  animation-delay: 1s;
}

.element-3 {
  width: 100px;
  height: 100px;
  bottom: 40px;
  left: 80px;
  animation-delay: 2s;
}

.element-4 {
  width: 40px;
  height: 40px;
  top: 60px;
  right: 80px;
  animation-delay: 3s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px) rotate(0deg);
  }
  33% {
    transform: translateY(-20px) rotate(120deg);
  }
  66% {
    transform: translateY(-10px) rotate(240deg);
  }
}

// 响应式设计
@media (max-width: 768px) {
  .error-container {
    flex-direction: column;
    gap: 40px;
    text-align: center;
  }

  .error-content {
    text-align: center;
  }

  .error-number {
    font-size: 80px;
  }

  .error-title {
    font-size: 28px;
  }

  .error-description {
    font-size: 16px;
    margin: 0 auto 30px;
  }

  .error-actions {
    justify-content: center;
  }

  .error-illustration {
    height: 250px;
  }

  .floating-elements {
    width: 200px;
    height: 200px;
  }
}

@media (max-width: 480px) {
  .error-404 {
    padding: 16px;
  }

  .error-number {
    font-size: 60px;
  }

  .error-title {
    font-size: 24px;
  }

  .error-description {
    font-size: 14px;
  }

  .error-actions {
    flex-direction: column;
    align-items: center;

    .arco-btn {
      width: 200px;
    }
  }
}
</style>
